﻿<!DOCTYPE html>
<html>
<head>
   <title>Cost function</title>
   <meta name="generator" content="Help & Manual">
   <meta name="keywords" content="">
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <link type="text/css" href="default.css" rel="stylesheet">
   <link type="text/css" href="custom.css" rel="stylesheet">
   <script type="text/javascript" src="nsh.js"></script>
   
<!-- non-scrolling headers for CHM and browser-based help, local styles-->
<style TYPE="text/css" media="screen"> 
   <!-- 
   body {    
      margin:0; 
      padding:0; 
      overflow: auto; 
      background: #edede9; 
   } 
   #idheader { 
      width:100%; 
      height:auto; 
      padding: 0; 
      margin: 0;     
} 
    #idheaderbg  {
    background: #E40A00; 
}
#idheadernowrap  {
    white-space:nowrap; 
}
    ul {list-style-type: lower-roman}
   -->
   </style>
   
<style TYPE="text/css" MEDIA="print">
<!--
/* Hide navigation links and add space between header
     and text in the printed version. Not valid for eBooks. */
#idnav { display:none;	 }
.topichead { padding: 5px 5px 20px 5px; }
-->
</style>   
   <script type="text/javascript" src="jquery.js"></script>
   <script type="text/javascript" src="helpman_settings.js"></script>
   <script type="text/javascript" src="helpman_topicinit.js"></script>

   <script type="text/javascript">
     HMSyncTOC("index.html", "motioncueing_cost_function.htm");
   </script>
   <script type="text/javascript" src="highlight.js"></script>
   <script type="text/javascript">
     $(document).ready(function(){highlight();});
   </script>
</head>
<body>

<!--ZOOMSTOP-->

<div id="idheader" >
<div id="idheaderbg">
<table width="100%" border="0" cellspacing="0" cellpadding="0" 
       style="margin: 0px; color: #D7D7D7;">

  <tr valign="middle">
    <td align="left" valign="middle" class="topichead">
    <!--<div id="idheadernowrap">-->
    <p class="crumbs" id="idnav"><b>Navigation:</b>&nbsp;
   
   VI-MotionCueing &gt; <a href="motioncueing_model_predictive_control.htm">Model predictive control</a>&nbsp;&gt;</p>
      <h1 class="p_Heading1" style="page-break-after: avoid;"><span class="f_Heading1">Cost function</span></h1>

    <!--</div>-->
    </td>
    <td align="right" width="180" valign="middle" class="topichead" id="idnav">
    <div id="idheadernowrap">
    <a href="javascript: print();"
    		onmouseover="document.images.prntr.src='print_a.png'" 
        onmouseout="document.images.prntr.src='print_n.png'"
        ><img name="prntr" border="0" alt="Print this Topic" title="Print this Topic" src="print_n.png"
        ></a>&nbsp;&nbsp;
     <a href="motioncueing_model.htm"
        onmouseover="document.images.prev.src='back_a.png'" 
        onmouseout="document.images.prev.src='back_n.png'"
        ><img name=prev src="back_n.png" border=0 alt="Previous page"
        ></a><a href="motioncueing_model_predictive_control.htm"
        onmouseover="document.images.main.src='top_a.png'" 
        onmouseout="document.images.main.src='top_n.png'"><img name=main src="top_n.png" border=0 alt="Return to chapter overview"
        ></a><a href="motioncueing_tilt_coordination.htm"
        onmouseover="document.images.next.src='next_a.png'" 
        onmouseout="document.images.next.src='next_n.png'"><img name=next src="next_n.png" border=0 alt="Next page"
        ></a>
    </div>
    </td>
  </tr>
</table>
</div>

<!-- The following code displays Expand All/Collapse All links  below the header in topics containing toggles -->
  

</div>  



<div id="idcontent"><div id="innerdiv"> 
<!--ZOOMRESTART-->
<p class="p_Normal">The optimal input sequence:</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal"><img src="embim9.png" width="92" height="25" style="margin:1px; border:none" alt="" /> &nbsp; &nbsp; <img src="embim10.png" width="124" height="27" style="margin:1px; border:none" alt="" /></p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">is computed by minimizing a cost function of the form:</p>
<p style="margin: 0px 0px 0px 24px;"><span style="color: #000000;">&nbsp;</span></p>
<p style="margin: 0px 0px 0px 24px;"><img src="embim11.png" width="377" height="67" style="margin:1px; border:none" alt="" /><span style="color: #1f497d;">(1)</span></p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">A cost function is minimized over a sequence of future input commands</p>
<p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 7px 0px 0px 48px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span class="f_NormalIndentParameters" style="font-style: italic;">y</span><span class="f_NormalIndentParameters"> are the perceived accelerations;</span></p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 7px 0px 0px 48px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span class="f_NormalIndentParameters" style="font-style: italic;">r</span><span class="f_NormalIndentParameters"> are the desired perceived accelerations;</span></p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 7px 0px 0px 48px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span class="f_NormalIndentParameters" style="font-style: italic;">Q</span><span class="f_NormalIndentParameters" style="font-size: 7pt; font-style: italic; vertical-align: sub;">y</span><span class="f_NormalIndentParameters">; </span><span class="f_NormalIndentParameters" style="font-style: italic;">Q</span><span class="f_NormalIndentParameters" style="font-size: 7pt; font-style: italic; vertical-align: sub;">u</span><span class="f_NormalIndentParameters">; </span><span class="f_NormalIndentParameters" style="font-style: italic;">Q</span><span class="f_NormalIndentParameters" style="font-size: 7pt; font-style: italic; vertical-align: sub;">x</span><span class="f_NormalIndentParameters"> are the weights, </span><span class="f_NormalIndentParameters" style="font-style: italic;">M</span><span class="f_NormalIndentParameters"> are the platform limits;</span></p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 7px 0px 0px 48px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span class="f_NormalIndentParameters" style="font-style: italic;">x</span><span class="f_NormalIndentParameters"> are the states;</span></p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 7px 0px 0px 48px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span class="f_NormalIndentParameters" style="font-style: italic;">u</span><span class="f_NormalIndentParameters"> are the reference for the platform control system</span></p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 7px 0px 0px 48px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span class="f_NormalIndentParameters" style="font-style: italic;">f</span><span class="f_NormalIndentParameters" style="font-size: 7pt; font-style: italic; vertical-align: sub;">1</span><span class="f_NormalIndentParameters">, </span><span class="f_NormalIndentParameters" style="font-style: italic;">f</span><span class="f_NormalIndentParameters" style="font-size: 7pt; font-style: italic; vertical-align: sub;">2</span><span class="f_NormalIndentParameters">, </span><span class="f_NormalIndentParameters" style="font-style: italic;">f</span><span class="f_NormalIndentParameters" style="font-size: 7pt; font-style: italic; vertical-align: sub;">3</span><span class="f_NormalIndentParameters"> are weight parameters.</span></p><p class="p_Normal" style="text-indent: -36px; margin: 0px 0px 0px 59px;">&nbsp;</p>
<p class="p_Normal"> <span style="font-style: italic;">J</span> is quadratic and takes into account the error between the predicted trajectory and the future reference in the prediction window of size <span style="font-style: italic;">N</span><span style="font-size: 7pt; font-style: italic; vertical-align: sub;">p</span>, and the future inputs and input difference in the control horizon <span style="font-style: italic;">N</span><span style="font-style: italic; vertical-align: sub;">c</span>: in the specific case <span style="font-style: italic;">N</span><span style="font-size: 7pt; font-style: italic; vertical-align: sub;">c </span><span style="font-style: italic;">&lt; N</span><span style="font-size: 7pt; font-style: italic; vertical-align: sub;">p</span> (as often done in the MPC framework). In this form, <span style="font-style: italic;">J(t)</span> has to be minimized over <span style="font-style: italic;">u(t)</span> and <span style="font-style: italic;">Δu(t)</span>. </p>
<p class="p_Normal">&nbsp;</p>
<p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 72px; margin: 0px 0px 0px 23px;"><span style="font-size:10pt; font-family: 'Times New Roman';color:#000000;display:inline-block;width:36px;margin-left:-36px">&#8226;</span>y are the perceived accelerations;</p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 72px; margin: 0px 0px 0px 23px;"><span style="font-size:10pt; font-family: 'Times New Roman';color:#000000;display:inline-block;width:36px;margin-left:-36px">&#8226;</span>r are the desired perceived accelerations;</p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 72px; margin: 0px 0px 0px 23px;"><span style="font-size:10pt; font-family: 'Times New Roman';color:#000000;display:inline-block;width:36px;margin-left:-36px">&#8226;</span>Qy ;Qu; Qx are the weights, M are the platform limits;</p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 72px; margin: 0px 0px 0px 23px;"><span style="font-size:10pt; font-family: 'Times New Roman';color:#000000;display:inline-block;width:36px;margin-left:-36px">&#8226;</span>x are the states;</p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 72px; margin: 0px 0px 0px 23px;"><span style="font-size:10pt; font-family: 'Times New Roman';color:#000000;display:inline-block;width:36px;margin-left:-36px">&#8226;</span>u are the reference for the platform control system</p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 72px; margin: 0px 0px 0px 23px;"><span style="font-size:10pt; font-family: 'Times New Roman';color:#000000;display:inline-block;width:36px;margin-left:-36px">&#8226;</span>f1, f2, f3 are weight parameters</p><p class="p_Normal" style="text-indent: -36px; margin: 0px 0px 0px 59px;">&nbsp;</p>
<p class="p_Normal"><span style="font-style: italic;">J</span> is quadratic, and takes into account the error between the predicted trajectory and the future reference in the prediction window of size <span style="font-style: italic;">N</span><span style="font-size: 7pt; font-style: italic; vertical-align: sub;">p</span>, and the future inputs and input difference in the control horizon <span style="font-style: italic;">N</span><span style="font-style: italic; vertical-align: sub;">c</span>: in the specific case <span style="font-style: italic;">N</span><span style="font-size: 7pt; font-style: italic; vertical-align: sub;">c </span><span style="font-style: italic;">&lt; N</span><span style="font-size: 7pt; font-style: italic; vertical-align: sub;">p</span> (as often done in the MPC framework). In this form, <span style="font-style: italic;">J(t)</span> has to be minimized over <span style="font-style: italic;">u(t)</span> and <span style="font-style: italic;">Δu(t)</span>. </p>
<p class="p_Normal">From the implementation point of view, the Quadratic Programming solver is the core of the MPC algorithm. In the application at hand, there are strict real-time requirements, since fast dynamics (control frequency of 100 Hz) calls for small computational times, and this leads to the use of online QP solvers which iteratively calculate the result at each sample time, without off-line pre-calculations.</p>

<!--ZOOMSTOP-->
</div></div>
<script type="text/javascript"> 
<!-- 
var lastSlashPos = document.URL.lastIndexOf("/") >
document.URL.lastIndexOf("\\") ? document.URL.lastIndexOf("/") :
document.URL.lastIndexOf("\\");
if( document.URL.substring( lastSlashPos + 1, lastSlashPos + 4
).toLowerCase() != "~hh" )
{
    nsrInit();
}
--> 
</script> 
</body>
</html>
